﻿@using Jqpress.Core.Domain.Enum;
@{
    //success messages
    var successMessages = new List<string>();
    if (TempData[string.Format("jqpress.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(TempData[string.Format("jqpress.notifications.{0}", NotifyType.Success)] as IList<string>);
    }
    if (ViewData[string.Format("jqpress.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(ViewData[string.Format("jqpress.notifications.{0}", NotifyType.Success)] as IList<string>);
    }

    //error messages
    var errorMessages = new List<string>();
    if (TempData[string.Format("jqpress.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(TempData[string.Format("jqpress.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
    if (ViewData[string.Format("jqpress.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(ViewData[string.Format("jqpress.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
}
@foreach (var message in successMessages)
{
    <div id="success" class="alert alert-success alert-dismissable"> 
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
      @Html.Raw(message)
    </div>
}
@foreach (var message in errorMessages)
{
    <div class="alert alert-danger alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
        @Html.Raw(message)
    </div>
}